<?php $this->renderFile(Yii::app()->basePath . "/views/store/header.php",array('salepoint' => $salepoint)); ?>

<div class="sub-header">
    <ul class="nav"> 
<!--        <li>
            <a href=".?ic=-1">
                All Item
            </a>
        </li>-->
        <?php foreach($categories as $key => $value):?>
        <li>
            <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?ic=<?php echo $key?>">
            <?php echo $value['NameCategory']?>
            </a>
        </li>                    
        <?php endforeach;?>
    </ul>
</div>
    <div class="item-row margin-top-20">
        <?php if (!isset($_GET['ic'])) {
                        $id_category = -1;                        
                }
                else $id_category = $_GET['ic'];
                
                if ($id_category != -1)
                $id_category = $categories[$id_category]['Id'];
                    ?>
        <?php         
        foreach ($items as $key => $value): ?>
        <?php 
        if ($id_category != -1){
            if ($value['IdCategory'] != $id_category) {
                continue;        
        }}
            ?>
        <div class="item-block">
            <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/item?ii=<?php echo $key?>">
                <img src="<?php echo Yii::app()->baseUrl."/files/".$value['LinkImage'];?>" alt="<?php echo $value['NameItem']?>"/>
            </a>
            <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/item?ii=<?php echo $key?>"><?php echo $value['NameItem']?></a>  
        </div>
         <?php endforeach; ?>
    </div>  

<?php $this->renderFile(Yii::app()->basePath . "/views/store/footer.php"); ?>
